/**
 * @param {number[]} numbers
 * @param {number} target
 * @return {number[]}
 */
var twoSum = function (numbers, target) {
  let left, right,flag = true
  for (let i = 0; i < numbers.length - 1 & flag; i++) {
    for (let j = numbers.length-1; j >i && flag; j--) {
      if (target - numbers[i] == numbers[j]) {
        left = i
        right = j
        flag = false
      }
    }
  }
  return [left + 1, right + 1]
}

console.log(twoSum([2, 3, 4], 6))
